package anjos.rn;

import anjos.dao.GenericDAO;
import anjos.modelo.Responsavel;
import java.util.List;

public class ResponsavelRN {

    private final GenericDAO dao = new GenericDAO();

    public Responsavel novo() {
        return new Responsavel();
    }

    public boolean salvar(Responsavel c) {
        if (c.getId() == null) {
            return dao.criar(c);
        } else {
            return dao.alterar(c);
        }
    }

    public boolean remover(Responsavel c) {
        return dao.excluir(c);
    }

    public Responsavel obter(Integer id) {
        return (Responsavel) dao.obter(Responsavel.class, id);
    }

    public List<Responsavel> obterTodos() {
        return dao.obterTodos(Responsavel.class);
    }
}
